<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  async function p1 () {
    // return "p1 success"
    throw new Error('p1 failed')
  }
  async function p2 () {
    // return "p2 success"
    throw new Error('p2 failed')
  }
  p1().then((value) => {
    console.log(value)
  }, (reason) => {
    console.log(reason)
    return p2 ()
  })
  .then((value) => {
    console.log(value)
  }, (reason) => {
    console.log(reason)
  })
</script>
</body>
</html>